/**
 * Created by chengming on 18/5/27.
 * version 1.0
 */
const BaseJsonAdapter = require('../base/BaseJsonAdapter');
const request = require('request-promise');
const iconv = require("iconv-lite");

/**
 * 对冲研投，深度阅读
 */
module.exports = class Hedgenews extends BaseJsonAdapter {

  async doRequest() {
    var options = {
      method: 'POST',
      uri: this.requestUrl,
      body: {
      },
      json: true // Automatically stringifies the body to JSON
    };
    let body = await request(options)
    return body
  }

  async reqJson() {
    let contents = []
    const datas = await this.doRequest();
    if (datas.arcs && datas.arcs.length) {
      datas.arcs.forEach(data => {
        contents.push({ title: data.title, href: 'https://bestanalyst.cn/fa?aid=' + data.aid })
      })
    }
    return { data: contents };
  }

}
